// 定义mark模型
const mongoose = require("mongoose")
const markSchema = new mongoose.Schema({
	openId: {
		type: String,
		required:[true,'操作者ID不能为空'],
	},
	latitude: {
		type: Number,
		required:[true,'维度不能为空']
	},
	longitude: {
		type: Number,
		required:[true,'经度不能为空']
	},
	title: {
		type: String,
		required:[true,'所处位置不能为空'],
		trim:true
	},
	address: {
		type: String,
		required:[true,'地址不能为空'],
		trim:true
	},
	imgs: [
		{ img: String }
	],
	markTime: {
		type: Date,
		default: new Date()
	},
	mem: {
		type: String,
	},
	flag: {
		type: Number,
		default: 1,
		enum: [0,1,2]  //0禁止显示、1正常状态、2不显示图片
	}
})
const markModel = mongoose.model("marks", markSchema)
module.exports = markModel